package org.dromara.hm.domain;

import org.dromara.common.mybatis.core.domain.BaseEntity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;

import java.io.Serial;

/**
 * 回款调整记录对象 hm_payment_adjustment
 *
 * @author Claude Code
 * @date 2025-01-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("hm_payment_adjustment")
public class HmPaymentAdjustment extends BaseEntity {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 调整记录ID
     */
    @TableId(value = "adjustment_id", type = IdType.AUTO)
    private Long adjustmentId;

    /**
     * 销售订单ID
     */
    private Long saleId;

    /**
     * 调整类型：DEBT_RELIEF=债务减免, ERROR_CORRECTION=错误修正, BAD_DEBT=坏账核销, AGING_ADJUSTMENT=账龄调整, DEBT_RESTRUCTURE=债务重组, OTHER=其他
     */
    private String adjustmentType;

    /**
     * 调整金额（正数=减少未回款，负数=增加未回款）
     */
    private BigDecimal adjustmentAmount;

    /**
     * 调整前未回款金额
     */
    private BigDecimal originalUnpaidAmount;

    /**
     * 调整后未回款金额
     */
    private BigDecimal newUnpaidAmount;

    /**
     * 原因代码
     */
    private String reasonCode;

    /**
     * 详细说明
     */
    private String description;

    /**
     * 证明材料文件路径（多个用逗号分隔）
     */
    private String proofFiles;

    /**
     * 申请时间
     */
    private Date applyTime;

    /**
     * 申请人ID
     */
    private Long applicantId;

    /**
     * 申请人姓名
     */
    private String applicantName;

    /**
     * 状态：PENDING=待审核, APPROVED=已批准, REJECTED=已驳回, CANCELLED=已取消
     */
    private String status;

    /**
     * 审核人ID
     */
    private Long approverId;

    /**
     * 审核人姓名
     */
    private String approverName;

    /**
     * 审核时间
     */
    private Date approveTime;

    /**
     * 审核备注
     */
    private String approveRemark;
}
